import { createMemoryHistory, createRouter } from 'vue-router'
import WorkSpace from '@/views/WorkSpace/index.vue'
import Replace from '@/views/Replace/index.vue'
import ReplaceDesign from '@/views/ReplaceDesign/index.vue'
import Open from '@/views/WorkSpace/Open.vue'
import Design from '@/views/Design/index.vue'

export const routes = [
    {
        path: '/',
        component: Open
    },
    {
        path: '/workSpace',
        component: WorkSpace,
        children: [
            {
                path: '',
                redirect: '/workSpace/replace'
            },
            {
                path: 'replace',
                component: Replace
            },
            {
                path: 'replace-design',
                component: ReplaceDesign
            },
            {
                path: 'design',
                component: Design
            }
        ]
    }
]

export const router = createRouter({
    history: createMemoryHistory(),
    routes
})
